
#define _CRT_SECURE_NO_WARNINGS	1
#include <iostream>
using namespace std;

int main() {

    int T;
    scanf("%d", &T);

    int a, b, c;
    while (T--)
    {
        int ans = 0;
        scanf("%d%d%d", &a, &b, &c);

        int mins = min(min(a, b), c);

        if (mins == b)
            ans += 2 * mins;
        else
            ans += 2 * mins + (b - mins) - 1;

        cout << ans << endl;
    }
    return 0;
}
